/**
 * @file
 * @auth jinguangguo
 * @date 2016/10/26
 */

import Vue from 'vue';
import VueRouter from 'vue-router';
import VueI18n from 'vue-i18n';
import messages from '../module/fund/lang';

import LangPopover from '../component/LangPopover.vue';

Vue.use(VueI18n);

import './base/init';

import Define from '../component/Define/Define.vue';

import Fund from '../module/fund/main';


let i18n =  new VueI18n({
    locale: window.app.LANG,
    messages, // set locale messages
});

const router = new VueRouter({
    'routes': [
        {
            path: '/',
            name: 'index',
            component: Fund
        }
    ]
});

const app = new Vue({
    i18n,
    router,
    components: {
        define: Define,
        LangPopover
    },
    watch: {
        '$route.path'(newVal, oldVal) {
            $('body').scrollTop(0);
        }
    }
}).$mount('#app');